<template>
  <v-snackbar
    v-model="messageStore.show"
    :color="messageStore.color"
    timeout="3000"
    location="top center"
    @update:modelValue="
      (val) => {
        if (!val) messageStore.clear()
      }
    "
  >
    {{ messageStore.text }}
  </v-snackbar>
</template>

<script setup>
import { useMessageStore } from '@/stores/MessageStore'

const messageStore = useMessageStore()
</script>
